package com.buanalintas.sandals.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "pos_transaction_retur_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionReturDetail.findAll", query = "SELECT p FROM PosTransactionReturDetail p"),
//    @NamedQuery(name = "PosTransactionReturDetail.findBySync", query = "SELECT p FROM PosTransactionReturDetail p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionReturDetail.findByReturDetailId", query = "SELECT p FROM PosTransactionReturDetail p WHERE p.returDetailId = :returDetailId"),
//    @NamedQuery(name = "PosTransactionReturDetail.findByReturDetailQuantity", query = "SELECT p FROM PosTransactionReturDetail p WHERE p.returDetailQuantity = :returDetailQuantity"),
//    @NamedQuery(name = "PosTransactionReturDetail.findByReturDetailPrice", query = "SELECT p FROM PosTransactionReturDetail p WHERE p.returDetailPrice = :returDetailPrice")})
public class PosTransactionReturDetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "retur_detail_id")
    private Integer returDetailId;
    @Column(name = "retur_detail_quantity")
    private Integer returDetailQuantity;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "retur_detail_price")
    private BigDecimal returDetailPrice;
    @Lob
    @Column(name = "retur_detail_description")
    private String returDetailDescription;
    @JoinColumn(name = "retur_detail_retur_id", referencedColumnName = "retur_id")
    @ManyToOne(optional = false)
    private PosTransactionRetur returDetailReturId;
    @JoinColumn(name = "retur_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne(optional = false)
    private PosMasterItem returDetailItemId;
    @JoinColumn(name = "retur_detail_size_id", referencedColumnName = "size_id")
    @ManyToOne(optional = false)
    private PosMasterSize returDetailSizeId;

    public PosTransactionReturDetail() {
    }

    public PosTransactionReturDetail(Integer returDetailId) {
        this.returDetailId = returDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getReturDetailId() {
        return returDetailId;
    }

    public void setReturDetailId(Integer returDetailId) {
        this.returDetailId = returDetailId;
    }

    public Integer getReturDetailQuantity() {
        return returDetailQuantity;
    }

    public void setReturDetailQuantity(Integer returDetailQuantity) {
        this.returDetailQuantity = returDetailQuantity;
    }

    public BigDecimal getReturDetailPrice() {
        return returDetailPrice;
    }

    public void setReturDetailPrice(BigDecimal returDetailPrice) {
        this.returDetailPrice = returDetailPrice;
    }

    public PosTransactionRetur getReturDetailReturId() {
        return returDetailReturId;
    }

    public void setReturDetailReturId(PosTransactionRetur returDetailReturId) {
        this.returDetailReturId = returDetailReturId;
    }

    public PosMasterItem getReturDetailItemId() {
        return returDetailItemId;
    }

    public void setReturDetailItemId(PosMasterItem returDetailItemId) {
        this.returDetailItemId = returDetailItemId;
    }

    public String getReturDetailDescription() {
        return returDetailDescription;
    }

    public void setReturDetailDescription(String returDetailDescription) {
        this.returDetailDescription = returDetailDescription;
    }

    public PosMasterSize getReturDetailSizeId() {
        return returDetailSizeId;
    }

    public void setReturDetailSizeId(PosMasterSize returDetailSizeId) {
        this.returDetailSizeId = returDetailSizeId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (returDetailId != null ? returDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionReturDetail)) {
            return false;
        }
        PosTransactionReturDetail other = (PosTransactionReturDetail) object;
        if ((this.returDetailId == null && other.returDetailId != null) || (this.returDetailId != null && !this.returDetailId.equals(other.returDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionReturDetail[ returDetailId=" + returDetailId + " ]";
    }
}
